package com.wfh.activity;

import com.wfh.R;
import com.wfh.util.Util;

import android.os.Bundle;
import android.app.Activity;
import android.util.Log;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.TextView;

public class CommonActivity extends Activity {

	protected void onCreate(Bundle savedInstanceState, Integer layout) {
		super.onCreate(savedInstanceState);
		setContentView(layout);
		this.setTopTitle(layout);// 设置标题
	}

	protected void setTopTitle(Integer layout) {
		TextView title = (TextView) findViewById(R.id.activty_title);
		switch (layout) {
		case R.layout.activity_home:
			title.setText(Util.getShare(this, "shop_name"));
			break;
		case R.layout.activity_interact:
			title.setText(R.string.interact);
			break;
		case R.layout.activity_setting:
			title.setText(R.string.more);
			break;
		case R.layout.activity_order:
			title.setText(R.string.orderlist);
			break;
		case R.layout.activity_shops:
			title.setText(R.string.shops);
			break;
		case R.layout.activity_tickets:
			title.setText(R.string.tickets);
			break;
		case R.layout.activity_mytickets:
			title.setText(R.string.mytickets);
			break;
		case R.layout.activity_map:
			title.setText(R.string.nav);
			break;
		case R.layout.activity_regist:
			title.setText(R.string.regist);
			break;
		case R.layout.activity_login:
			title.setText(R.string.login);
			break;
		case R.layout.activity_findpasword:
			title.setText(R.string.findpassword);
			break;
		case R.layout.activity_share:
			title.setText(R.string.share);
			break;	
		case R.layout.activity_sharelist:
			title.setText(R.string.sharelist);
			break;
		
		}
	}


}
